#include<stdio.h>
int main()
{
	for (int i = 10000; i <= 99999; i++)
	{
		int a = 0;
		int b = 0;
		int count = 1;
		int sum = 0;
		while (count < 100000)
		{
			a = i / 10 * count;
			b = i % 10 * count;
			sum = a * b+sum;
		}
		if (sum == i)
			printf("%d ", sum);
	}
	return 0;
}